import { TouchEventType } from "./defineConfig"

// 对点击对象进行缩放效果
function setNodePressState(node: cc.Node, callback?: Function) {
    cc.tween(node).to(0.1, { scale: 0.9 }).to(0.1, { scale: 1 }).call(() => {
        callback && callback()
    }).start()
}

// 点击事件
function nodeTouchStart(node: cc.Node, callback?: Function, targert?: any) {
    node.on(TouchEventType.touchStart, () => {
        setNodePressState(node, callback)
    }, targert)
}

export {
    nodeTouchStart
}